UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'HcxmnLww78+1Nws1pAKmmD8uemz2flCpiOro8jaVzDw='
WHERE
key_id = '3c1d6e544a28baf9697dd5b34eed045fafbcfcab9c9501fb4c38726a38d887f3'
AND (
token = 'HcxmnLww78+1Nws1pAKmmD8uemz2flCpiOro8jaVzDw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)