UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'woGG6OgfqPUJqwx65eRNo84lamZeEao6apvgAXxdMP8='
WHERE
key_id = 'cc0e9abc892da1612ed3ad383c200e6f1ab6edaa88ad66a8296cdbde99b9bb2e'
AND (
token = 'woGG6OgfqPUJqwx65eRNo84lamZeEao6apvgAXxdMP8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)