UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'EfQbx3ooUHjpfPvUHvV+mV+olBSwVoKGb6LEZmsJOJY='
WHERE
key_id = 'be785ce3c04f08697b261246cfb4eeb863eb386ae5d468e13b997e15b5d35112'
AND (
token = 'EfQbx3ooUHjpfPvUHvV+mV+olBSwVoKGb6LEZmsJOJY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)