UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3R5Uh7hWJa4IFr4XEQBbLEgSAENIUiuSM5YOpYWKSZ0='
WHERE
key_id = '1a1da5a8ea0cb55e40ff6211a5edefc7072ecff2fd1592e8725ee806bbef75b7'
AND (
token = '3R5Uh7hWJa4IFr4XEQBbLEgSAENIUiuSM5YOpYWKSZ0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)