UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '42NwGwFf96GogkUyS78if4I/xG7nVr33M+k+3fS5PLE=' 
WHERE 
  key_id = '54819379d72594b7a72f5ed345416bf363b82808762be167990776b1aaaa66fc' 
  AND (
    token = '42NwGwFf96GogkUyS78if4I/xG7nVr33M+k+3fS5PLE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030