UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Eza6beG1PScFrNO1H2/1nnZAj9pMPsWB11y/c2wQoPw='
WHERE
key_id = 'b8c11ac31221283d600323481712200fa6fdebc71c745fbb5fd81b055baf011a'
AND (
token = 'Eza6beG1PScFrNO1H2/1nnZAj9pMPsWB11y/c2wQoPw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)