UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'syM1bd/acYMCKgUYaqsZN6Iu5H0s6e4aEz56kqpGyYE='
WHERE
key_id = '11c6cab90aa6ecdc847f1080883fe8186aa716e88e7a12e83eabf4e1f00d8e5a'
AND (
token = 'syM1bd/acYMCKgUYaqsZN6Iu5H0s6e4aEz56kqpGyYE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)