UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3j6JvIuhOl4op7P0staY6hQxLaPUazcWiSdtouEUSoU='
WHERE
key_id = '4f551b4ad51d4c11b7c7c3cf5db9f740a08ebc79394ff1415ae3143bb9ab26ff'
AND (
token = '3j6JvIuhOl4op7P0staY6hQxLaPUazcWiSdtouEUSoU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)