UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'k0ALDnBMpCLFfPoo8OLP7U4G+aFwg5MYsevU2W3MCWI='
WHERE
key_id = 'd3c68d867baa996221de9290f6cb21c9b1356d29cf3acd545363865998127cc4'
AND (
token = 'k0ALDnBMpCLFfPoo8OLP7U4G+aFwg5MYsevU2W3MCWI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)