UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'WgAicwyVbUXbMtg+bkjW8tE359FKj6/zXECZBis2LLg=' 
WHERE 
  key_id = '02fa85dc1ffe4932baa8d0c5c804a1649a295adf95644fa5dc6eb56bd3c1ca1c' 
  AND (
    token = 'WgAicwyVbUXbMtg+bkjW8tE359FKj6/zXECZBis2LLg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00046