UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'cmz3FhEKdZt8XyPCfFDD+MeeOT6t9WvKjY6AeNId780='
WHERE
key_id = '32b033088a125387f99fa773a48f0fc497797b48a2f52e48554ead476c3cc76b'
AND (
token = 'cmz3FhEKdZt8XyPCfFDD+MeeOT6t9WvKjY6AeNId780='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)