UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'orG0UgxADJy9JNEdUbN5AR9umAglTMa2M4VMmoEgw4I=' 
WHERE 
  key_id = '052509eefe9c630ebde506db7ae73e74ca17b777512937a83d1c0defe6994de5' 
  AND (
    token = 'orG0UgxADJy9JNEdUbN5AR9umAglTMa2M4VMmoEgw4I=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035