UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ExmdKaXaeZtlOJ9QLcsN/r7WiGseo6uxSfUvvOJUGkE='
WHERE
key_id = 'e3afb2b344c76612f1dc43fccc586d070f382b2cbecbc1eb412603a7a41b2518'
AND (
token = 'ExmdKaXaeZtlOJ9QLcsN/r7WiGseo6uxSfUvvOJUGkE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)