UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '1YQFen5lY0X0ViyPWEcaXxKZmP1zpHZEP+D2Bg6RR/8=' 
WHERE 
  key_id = 'f3ead234fe3b62fa7a5c6f8d587bc47b4b81e933c879ba46f19322a9540d1988' 
  AND (
    token = '1YQFen5lY0X0ViyPWEcaXxKZmP1zpHZEP+D2Bg6RR/8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029