UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'wp0GgQ5R51urX9K2jAK2fnXmI/Lkq+4OCTvlheTRtvs='
WHERE
key_id = 'c5cc67051362a880749380ff0e59136bc2441ae9b4b87c4ac48cee3cd4ad52ec'
AND (
token = 'wp0GgQ5R51urX9K2jAK2fnXmI/Lkq+4OCTvlheTRtvs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)