UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'XWBZS20D0J2lcxcNlluSO0cSAeUeZ236DDa5xWSfFQA='
WHERE
key_id = '54a02b706503bb81c9a435c2bcd4f3fc15f0444087c1001ea31ddbf205b06d4d'
AND (
token = 'XWBZS20D0J2lcxcNlluSO0cSAeUeZ236DDa5xWSfFQA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)