UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '5dpvZKNxsuMsPRRR+sAtxW8RANUeWzXo3Z70sO88CaY='
WHERE
key_id = 'ab855323f6b57573f202691c162263d564cd33e28cba8b2dea37909e681eb13c'
AND (
token = '5dpvZKNxsuMsPRRR+sAtxW8RANUeWzXo3Z70sO88CaY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)