UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'kNmIMAbUih7HiKqAnp5T89T9AOqZcuoDiHED1wY/4C4='
WHERE
key_id = 'd185393b98ac631d3c96388f571ea9e8147ae7d892741cb3770bc648db34b427'
AND (
token = 'kNmIMAbUih7HiKqAnp5T89T9AOqZcuoDiHED1wY/4C4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)