UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Z0wWUAcSWkjUZj7EtQnUahYUylgUBIf3bRr+1Z5o0u4='
WHERE
key_id = '11de962feec45388b17bed20e059fb6ab81295a91ef61f6611622008e61fcc59'
AND (
token = 'Z0wWUAcSWkjUZj7EtQnUahYUylgUBIf3bRr+1Z5o0u4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)