UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '6GbjiFioCbDMHfpMWDV+bIhSA01jIhdzchiXYCDJ2s4=' 
WHERE 
  key_id = 'd23d8ebd0f7d82d0d582aa63d2faa17f3666fade0d6e6bbe21328db28de3f83e' 
  AND (
    token = '6GbjiFioCbDMHfpMWDV+bIhSA01jIhdzchiXYCDJ2s4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023