UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'WsPJgQ8nziThVy4Xxfb+kUkYCxodGFwBUamrevSepZY='
WHERE
key_id = '1ac022e705a5291098c370d00a72a184c93f606643be78b6fd51f17ab2e4c7a5'
AND (
token = 'WsPJgQ8nziThVy4Xxfb+kUkYCxodGFwBUamrevSepZY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)