UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '5JwUbINJBe1xrWjTN60SHzpksZ4bbfDnWUSAPtGOA9g='
WHERE
key_id = '03cd1497c499ed93f3e448ceb3cac9c6a51e98a166a9012cc7d6c4d6f122abce'
AND (
token = '5JwUbINJBe1xrWjTN60SHzpksZ4bbfDnWUSAPtGOA9g='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)