UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'uysWbSHHkTxy8IdHRaTzy7FVb8I/HNKgJUZC7T/hFi4=' 
WHERE 
  key_id = '7ab48ec05e27d339e6f5f767a918987b962fd420fa7953196fe6db5e392b35bc' 
  AND (
    token = 'uysWbSHHkTxy8IdHRaTzy7FVb8I/HNKgJUZC7T/hFi4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00046