UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'cBIO+8hoGSooyYsZQ+cxgrv3MKASw0CqmMPUefGaRUI='
WHERE
key_id = 'aed734e9c5f10ec291f3c454f2bfe7652e4a0ab4655ca90a065af8304b52e767'
AND (
token = 'cBIO+8hoGSooyYsZQ+cxgrv3MKASw0CqmMPUefGaRUI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)