UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'QlKdgJVvRGImDrc/74EMrfpaocLQYazYI8VyxWSxfA0=' 
WHERE 
  key_id = 'b98cf05bdaf8d1186277fe7c69dfea6db1b9efb6d8db527fb75384bb9a69f747' 
  AND (
    token = 'QlKdgJVvRGImDrc/74EMrfpaocLQYazYI8VyxWSxfA0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031