UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Ur61MYTE/67dam8/g8KsqO3r8H4XLbsTv0qTaX2xHzg='
WHERE
key_id = '0d2548bbe36c318c07c61ac68c80ba3afc667953779b3304e5d6d292266e40b5'
AND (
token = 'Ur61MYTE/67dam8/g8KsqO3r8H4XLbsTv0qTaX2xHzg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)