UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'jJUZNTarkVL62RH9/uI/5vYOENxRNAIQVfRMYJxRlx0='
WHERE
key_id = '03eb502175403db17087663aac333ad8056617eccebc04b433d61083b9e648ac'
AND (
token = 'jJUZNTarkVL62RH9/uI/5vYOENxRNAIQVfRMYJxRlx0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)