UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'xAEzbxzGbXWh/UxL3n9Lz87oMxoN2uzKbSDPast3NDk='
WHERE
key_id = '0dd8da9d4a1c914268982f7d47f8eabd9f5db833a6d8f99407a8e05983248fe8'
AND (
token = 'xAEzbxzGbXWh/UxL3n9Lz87oMxoN2uzKbSDPast3NDk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)